package com.dd.common.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author cheng
 */
@Schema(description = "修改密码DTO")
@Data
public class UpdatePasswordDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotBlank(message = "原密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_]{6,32}$", message = "密码只能包含字母、数字、下划线，长度6-32个字符")
    private String oldPassword;

    @NotBlank(message = "新密码不能为空")
    @Size(min = 6, max = 20, message = "新密码长度为6-20位")
    @Pattern(regexp = "^[a-zA-Z0-9_]{6,32}$", message = "密码只能包含字母、数字、下划线，长度6-32个字符")
    private String newPassword;

    @NotBlank(message = "确认密码不能为空")
    private String confirmPassword;
}
